﻿/*
* Copyright (C) 2024-2025 Uniontech Technology Co., Ltd.
*
* Author:      zhangbingyi <zhangbingyi@uniontech.com>
*
* Maintainer:  zhangbingyi <zhangbingyi@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "compixmap.h"
#include "widgets/ddialog.h"

#include <QWidget>
#include <QLabel>

// 自定义等级切换类型
enum SecurityLevelChangeType {
    LMtoHigh = 0, // 低、中到高
    HtoMedium, // 高到中
    LtoMedium, // 低到中
    HtoLow, // 高到低
    MtoLow // 中到低

};

class SecurityLevelChangeDialog : public DDialog
{
    Q_OBJECT
public:
    explicit SecurityLevelChangeDialog(int type, QWidget *parent = nullptr);
    ~SecurityLevelChangeDialog() override;

    void init(int type);

Q_SIGNALS:
    // 弹框点击确定完成信号
    void notifyDialogFinish();
    // 弹框点击确定完成信号
    void notifyDialogClose();

protected:
    void closeEvent(QCloseEvent *event) override;

public slots:
    void onButtonClicked(int index, const QString &text);
private:
    int m_type;
    bool m_isFinishFlag;

    QString changeTxt(int nType);
    QString changeTip(int nType);

    // 根据弹窗类型设置不同高度
    void refreshDailogHeightSize(int nType);
};
